<body>
    <form id="my-form">
        <div id="tools" class="datagrid-toolbar">
            <input type="hidden" name="type" id="type" value="63">
            <input type="hidden" name="objectId" id="objectId" value="">
            <a id="closeBtn" name="backOk" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-close"
                plain="true"><span class="l-btn-left"><span
                        class="l-btn-text icon-close l-btn-icon-left">关闭</span></span></a>
        </div>
        <p id="errorMsg" style="color:red;margin-top:5px;"></p>
        <table class="formTable">

            <tbody>
                <tr>
                    <td class="tdc1" style="width:150px;">
                        部门/项目经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="applyUserName" id="applyUserName" data-options="required:true"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="applyUserId" id="applyUserId" value="982">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        录入意见：
                    </td>
                    <td colspan="3">
                        <textarea name="lrOption" id="lrOption" style="width:732px;height:100px"
                            data-options="required:true" class="easyui-validatebox validatebox-text"
                            readonly="">姚雨列试用期内，工作态度端正，主动学习业务知识，快速掌握活动部核心技能，能高效完成各项任务，多次配合团队攻克工作难点。日常中积极沟通协作，责任心强，展现出良好的职业素养与适应能力。综合评估，符合转正条件，同意按期转正。</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        副总经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="deptmanagername" id="deptmanagername"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="deptmanagerid" id="deptmanagerid" value="566">
                    </td>
                </tr>
                <!--  <tr>
					<td class="tdc1">
						人力资源部：
					</td>
					<td colspan="3">
						<input type="text" name="hrdeptname" id="hrdeptname" class="easyui-validatebox" readonly/>
						<input type="hidden" name="hrdeptid" id="hrdeptid"/>
					</td>
				</tr>-->
                <tr>
                    <td class="tdc1">
                        总经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="managername" id="managername"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="managerid" id="managerid" value="561">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        董事长：
                    </td>
                    <td colspan="3">
                        <input type="text" name="presidentname" id="presidentname"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="presidentid" id="presidentid" value="560">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        姓 名：
                    </td>
                    <td style="width:38%;">
                        <input type="text" name="name" id="name" data-options="required:true"
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1" style="width:150px;">
                        性 别：
                    </td>
                    <td>
                        <input type="text" name="sex" id="sex" data-options="required:true"
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        出生年月：
                    </td>
                    <td>
                        <input type="text" name="birthday" id="birthday" readonly="readonly"
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1">
                        学 历：
                    </td>
                    <td>
                        <input type="text" name="education" id="education" class="easyui-validatebox validatebox-text">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        所在部门：
                    </td>
                    <td>
                        <input type="text" name="deptname" id="deptname" class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1">
                        岗 位：
                    </td>
                    <td>
                        <input type="text" name="jobs" id="jobs" class="easyui-validatebox validatebox-text">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        到职时间
                    </td>
                    <td>
                        <input type="text" name="starttime" id="starttime" readonly="readonly"
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1">
                        应转正时间
                    </td>
                    <td>
                        <input type="text" name="positiveTime" id="positiveTime" readonly="readonly"
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        员工试期表现及评价：
                    </td>
                    <td colspan="3">
                        <textarea name="evaluation" id="evaluation" style="width:732px;height:100px"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        相关资料：
                    </td>
                    <td colspan="3">
                        <div style="margin-left:10px;">
                            <div id="showFiles">
                                <div style="margin-top:8px;margin-bottom:8px;">姚雨列转正申请书.docx<a style="margin-left:10px"
                                        href="javascript:" onclick="downfile(778025)">下载</a></div>
                            </div>
                            <span id="uploadBtn">上传</span>

                            <div id="fsUploadProgress"></div>
                            <input id="btnCancel" type="button" onclick="swfu.cancelQueue();" class="quxiaobtn">

                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        福利费用享受起始时间：
                    </td>
                    <td>
                        <input type="text" name="enjoyDate" id="enjoyDate" readonly="readonly"
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td>

                    </td>
                    <td>
                    </td>
                </tr>

            </tbody>
        </table>

        <div style="margin-left:10px;">
            <div id="showRecords">
                <div style="margin-top:8px;margin-bottom:8px;">审核人：韩威<span style="margin-left:15px;">审核时间：2025-10-15
                        08:53:33</span><span style="margin-left:15px;">审核选项：同意</span><span
                        style="margin-left:15px;">审核意见：同意</span></div>
                <div style="margin-top:8px;margin-bottom:8px;">审核人：沈全洪<span style="margin-left:15px;">审核时间：2025-10-15
                        09:34:47</span><span style="margin-left:15px;">审核选项：同意</span><span
                        style="margin-left:15px;">审核意见：同意</span></div>
                <div style="margin-top:8px;margin-bottom:8px;">审核人：张金生<span style="margin-left:15px;">审核时间：2025-10-23
                        09:32:50</span><span style="margin-left:15px;">审核选项：同意</span><span
                        style="margin-left:15px;">审核意见：同意</span></div>
                <div style="margin-top:8px;margin-bottom:8px;">复核人：王一翀<span style="margin-left:15px;">复核时间：2025-10-23
                        09:56:34</span><span style="margin-left:15px;">复核选项：同意</span><span
                        style="margin-left:15px;">复核意见：同意</span></div>
            </div>
        </div>


        <script>


            function checkFormMe(form) {

                return $('#my-form').form('validate');
            }

            var type = $.getUrlParam("type");

            $("#type").val(type);

            var p_id = $.getUrlParam("id");

            var objectId = new Date().getTime();
            $("#objectId").val(objectId);


            function getAffixs() {
                $.ajax({
                    type: "POST",
                    url: contextPath + "affixs",
                    data: { "objectType": 631, objectId: objectId },
                    dataType: "json",
                    success: function (data) {
                        if (data && data.length > 0) {
                            showAffixs(data);
                        } else {
                            $("#showFiles").html("");
                        }
                    },
                    error: function (response) {
                        $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                            $.messager.alert("提示", response.responseText, 'error');
                        });
                    }

                });
            }

            function showAffixs(data) {
                var fileHtml = "";
                for (var i = 0; i < data.length; i++) {
                    fileHtml += "<div style=\"margin-top:8px;margin-bottom:8px;\">" + data[i].name;
                    fileHtml += "<a style=\"margin-left:10px\" href=\"javascript:\" onclick=\"downfile(" + data[i].id + ")\">下载</a></div>";
                }
                $("#showFiles").html(fileHtml);
            }



            var process_id = $.getUrlParam("processid");
            if (process_id != null) {
                $.ajax({
                    type: "GET",
                    url: contextPath + "manager/approvalprocess/getBeanIdByProcessId/" + process_id + "/" + type,
                    data: null,
                    dataType: "json",
                    success: function (data) {
                        if (data && data.handleMsg.status == 1) {
                            p_id = data.id;
                            if (p_id != null) {
                                objectId = p_id;
                            }
                            $("#objectId").val(objectId);

                            loadBassModel(p_id);
                            loadRecord(process_id)
                        }
                    },
                    error: function (response) {
                        $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                            $.messager.alert("提示", response.responseText, 'error');
                        });
                    }

                });
            } else {
                $("#objectId").val(objectId);
                loadBassModel(p_id);
                loadRecord(process_id)
            }

            function loadBassModel(p_id) {
                var BaseModel = Backbone.Model.extend({ urlRoot: contextPath + 'manager/personPositive' });
                var baseModel;

                if (p_id == null) {
                    baseModel = new BaseModel();
                } else {
                    baseModel = new BaseModel({ id: p_id, i: new Date().getTime() });
                }
                var baseView = new BaseView({ el: $("#my-form"), model: baseModel });
                if (p_id != null) {
                    baseView.doLoad(loadMe);
                }
            }

            function loadMe(model, response, options) {
                if (model.get("approvalProcess")) {
                    $("#applyUserName").val(model.get("approvalProcess").applyUserName);
                    $("#applyUserId").val(model.get("approvalProcess").applyUserId);
                    $("#type").val(model.get("approvalProcess").type);
                    $("#lrOption").text(model.get("lrOption"));
                    getAffixs();
                }
            }

            ////加载领导审核意见
            function loadRecord(process_id) {
                $.ajax({
                    type: "POST",
                    url: contextPath + "manager/approvalRecords/listApprovalRecord/" + process_id,
                    data: {},
                    dataType: "json",
                    success: function (data) {
                        if (data) {
                            var rHtml = "";
                            var msg = "审核"
                            for (var i = 0; i < data.length; i++) {
                                if (data[i].userType == 5) {
                                    msg = "复核";
                                } else {
                                    msg = "审核"
                                }
                                rHtml += "<div style=\"margin-top:8px;margin-bottom:8px;\">" + msg + "人：" + data[i].approvalUser.truename + "";
                                if (data[i].approvalDate == null) {
                                    rHtml += "<span style=\"margin-left:15px;\">尚未" + msg + "</span>";
                                } else {
                                    rHtml += "<span style=\"margin-left:15px;\">" + msg + "时间：" + data[i].approvalDate + "</span>";
                                    if (data[i].approvalType == 1) {
                                        rHtml += "<span style=\"margin-left:15px;\">" + msg + "选项：同意</span>";
                                    } else {
                                        rHtml += "<span style=\"margin-left:15px;\">" + msg + "选项：不同意</span>";
                                    }
                                    rHtml += "<span style=\"margin-left:15px;\">" + msg + "意见：" + data[i].opinion + "</span>";
                                }
                                rHtml += "</div>";
                            }
                            $("#showRecords").html(rHtml);
                        }
                    },
                    error: function (response) {
                        $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                            $.messager.alert("提示", response.responseText, 'error');
                        });
                    }
                });
            }

            var userType = $.getUrlParam("userType");
            if (userType == 5) {
                //复核可以编辑
                $("#approvalBtn").text("复核");
                $("#tr1").show();
                $('textarea[name="dashengOpinion"]').attr("readonly", "readonly")
                $("#tr2").show();
            } else if (userType == 3 || userType == 4) {
                $("#tr1").show();
            }


        </script>
    </form>
    <div id="loading1"
        style="position: absolute; left: 0px; top: 0px; width: 100%; height: 703px; background: rgb(232, 232, 232); opacity: 0.5; z-index: 10000; display: none;">
    </div>
    <div id="loading2" class="panel-loading"
        style="position: fixed; top: 38%; left: 41%; border: 2px solid rgb(149, 184, 231); width: 160px; font-size: 14px; z-index: 10001; background: url(&quot;/system/jquery/themes/themes1/images/loading-1.gif&quot;) 10px 8px no-repeat rgb(255, 255, 255); display: none;">
        正在处理，请稍等...</div>
</body>